<template>

  <!--  <div>-->
  <!--    关键字： <el-input v-model="form.quan" placeholder="请输入手机号/ID"></el-input>-->
  <!--  </div>-->
  <!--  关键字： <el-input v-model="form.quan" placeholder="请输入手机号/ID"></el-input>&ndash;&gt;-->
  <el-container class="home-container">
    <el-header><!-- 头部区 -->
      <div>
        <span>智能快递柜后台管理系统</span>
      </div>
      <el-menu
          :default-active="activeIndex"
          class="el-menu-demo"
          mode="horizontal"
          @select="handleSelect"
          background-color="#545c64"
          text-color="#fff"
          active-text-color="#ffd04b"
          id="indexMenu">
        <el-menu-item index="1" @click="shouye">首页</el-menu-item>
        <el-menu-item index="2" @click="huiyuan">会员</el-menu-item>
        <el-menu-item index="3" @click="goToMachine">柜机</el-menu-item>
        <el-menu-item index="4" @click="baoguo">包裹</el-menu-item>
        <el-menu-item index="5" @click="tiaozhuan">财务</el-menu-item>
        <el-menu-item index="6" @click="other">其他</el-menu-item>
      </el-menu>
    </el-header>
    <!-- 页面主体区域 -->
    <el-container>
      <!-- 侧边栏 -->
      <el-aside width="210px" hight="100%">
        <el-menu
            class="el-menu-vertical-demo"
            background-color="#545c64"
            text-color="#fff"
            active-text-color="#ffd04b">
          <el-submenu index="1">
            <template slot="title">
              <i class="el-icon-location"></i>
              <span>财务管理</span>
            </template>
            <el-menu-item-group>
              <!--              <template slot="title">分组一</template>-->
              <el-menu-item index="1-1" @click="zhanghu">账户信息</el-menu-item>
              <el-menu-item index="1-2" @click="zhifu">支付记录</el-menu-item>
              <el-menu-item index="1-3" @click="chongzhiji">充值记录</el-menu-item>
              <el-menu-item index="1-4" @click="huilv">汇率管理</el-menu-item>

              <!--              <el-menu-item index="1-2">选项2</el-menu-item>-->
            </el-menu-item-group>
            <!--            <el-menu-item-group title="分组2">-->
            <!--              <el-menu-item index="1-3">支付记录</el-menu-item>-->
            <!--            </el-menu-item-group>-->
          </el-submenu>
          <el-submenu index="2">
            <template slot="title">
              <i class="el-icon-location"></i>
              <span>意见反馈</span>
            </template>
            <el-menu-item-group>
              <!--              <template slot="title">分组一</template>-->
              <el-menu-item index="1-1" @click="yijian">意见反馈</el-menu-item>
              <el-menu-item index="1-2" >反馈详情-未处理</el-menu-item>
              <el-menu-item index="1-3" >反馈详情-跟进中</el-menu-item>
              <el-menu-item index="1-4" >反馈详情-已完结</el-menu-item>
              <el-menu-item index="1-4" >回复反馈</el-menu-item>

            </el-menu-item-group>
            <!--            <el-menu-item-group title="分组2">-->
            <!--              <el-menu-item index="1-3">支付记录</el-menu-item>-->
            <!--            </el-menu-item-group>-->
          </el-submenu>

          <el-menu-item index="4">
            <i class="el-icon-setting"></i>
            <span slot="title">导航四</span>
          </el-menu-item>
        </el-menu>
      </el-aside>
      <!-- 右侧内容主体 -->
      <el-main>
        <!--<span>aaa</span>-->
        <div style="float: left">
          <span style="color: #545c64 ; font-size: 12px">财务管理/充值记录/充值详情</span>
        </div>
        <br><br>


        <div style="background-color: white;width: 100%;height: 100%">

          <div style="border-bottom: #181818;width: 200px;">
            <span style="float: left;font-weight: bold;margin-left: 10px;margin-top: 10px">充值详情</span><br><br>
          </div>
          <hr width="100%"><br><br>
          <div style="float: right;margin-right: 20px" @click="fanhui">返回</div>

          <!--          充值状态为待支付展示-->

          <div v-if="this.status==2" style="float: left">
            <p>状态：&nbsp;&nbsp;&nbsp;<span style="font-size: 20px; font-weight: bold;">{{this.payment.status==2?'待支付':''}}</span></p>
            <p>交易号：&nbsp;&nbsp;&nbsp;{{this.payment.transactionNumber}}</p>
            <p>会员类型：&nbsp;&nbsp;&nbsp;{{this.payment.type==1?'快递员':this.payment.type==2?'普通会员':''}}</p>
            <p>手机号码：&nbsp;&nbsp;&nbsp;+86{{this.payment.phone}}</p>
            <p>充值金额：&nbsp;&nbsp;&nbsp;{{this.payment.rechargeAmount}}</p>
            <p>充值后余额：&nbsp;&nbsp;&nbsp;{{this.payment.balanceAfterRecharging}}</p>
            <p>充值币种：&nbsp;&nbsp;&nbsp;{{this.payment.rechargeCurrency==1?'CNY':'PHP'}}</p>
            <p>实际支付CNY：&nbsp;&nbsp;&nbsp;{{this.payment.actualPayment}}</p>
            <p>汇率：&nbsp;&nbsp;&nbsp;{{this.payment.exchangeRate}}</p>

            <p>创建时间：&nbsp;&nbsp;&nbsp;{{this.payment.createTime|format('yyyy-MM-dd hh:mm:ss')}}</p>
          </div>

<!--          充值状态为充值中展示-->
          <div v-if="this.status==1" style="float: left">

            <p>状态：&nbsp;&nbsp;&nbsp;<span style="font-size: 20px; font-weight: bold;">{{this.payment.status==1?'充值中':''}}</span></p>
            <p>交易号：&nbsp;&nbsp;&nbsp;{{this.payment.transactionNumber}}</p>
            <p>会员类型：&nbsp;&nbsp;&nbsp;{{this.payment.type==1?'快递员':this.payment.type==2?'普通会员':''}}</p>
            <p>手机号码：&nbsp;&nbsp;&nbsp;+86{{this.payment.phone}}</p>
            <p>充值金额：&nbsp;&nbsp;&nbsp;{{this.payment.rechargeAmount}}</p>
            <p>充值后余额：&nbsp;&nbsp;&nbsp;{{this.payment.balanceAfterRecharging}}</p>
            <p>充值币种：&nbsp;&nbsp;&nbsp;{{this.payment.rechargeCurrency==1?'CNY':'PHP'}}</p>
            <p>实际支付CNY：&nbsp;&nbsp;&nbsp;{{this.payment.actualPayment}}</p>
            <p>汇率：&nbsp;&nbsp;&nbsp;{{this.payment.exchangeRate}}</p>
            <p>付款方式：&nbsp;&nbsp;&nbsp;{{this.payment.rechargeChannels==1?'微信支付':this.payment.rechargeChannels==2?'支付宝支付':'贝宝支付'}}</p>
            <p>付款账号：&nbsp;&nbsp;&nbsp;{{this.payment.registerIp}}</p>
            <p>创建时间：&nbsp;&nbsp;&nbsp;{{this.payment.createTime|format('yyyy-MM-dd hh:mm:ss')}}</p>
            <p>付款时间：&nbsp;&nbsp;&nbsp;{{this.payment.fuTime|format('yyyy-MM-dd hh:mm:ss')}}</p>

          </div>

          <!--          充值状态为充值成功展示-->
          <div v-if="this.status==3" style="float: left">
            <p>状态：&nbsp;&nbsp;&nbsp;<span style="font-size: 20px; font-weight: bold;">{{this.payment.status==3?'充值成功':''}}</span></p>
            <p>交易号：&nbsp;&nbsp;&nbsp;{{this.payment.transactionNumber}}</p>
            <p>会员类型：&nbsp;&nbsp;&nbsp;{{this.payment.type==1?'快递员':this.payment.type==2?'普通会员':''}}</p>
            <p>手机号码：&nbsp;&nbsp;&nbsp;+86{{this.payment.phone}}</p>
            <p>充值金额：&nbsp;&nbsp;&nbsp;{{this.payment.rechargeAmount}}</p>
            <p>充值后余额：&nbsp;&nbsp;&nbsp;{{this.payment.balanceAfterRecharging}}</p>
            <p>充值币种：&nbsp;&nbsp;&nbsp;{{this.payment.rechargeCurrency==1?'CNY':'PHP'}}</p>
            <p>实际支付CNY：&nbsp;&nbsp;&nbsp;{{this.payment.actualPayment}}</p>
            <p>汇率：&nbsp;&nbsp;&nbsp;{{this.payment.exchangeRate}}</p>
            <p>付款方式：&nbsp;&nbsp;&nbsp;{{this.payment.rechargeChannels==1?'微信支付':this.payment.rechargeChannels==2?'支付宝支付':'贝宝支付'}}</p>
            <p>付款账号：&nbsp;&nbsp;&nbsp;{{this.payment.registerIp}}</p>
            <p>创建时间：&nbsp;&nbsp;&nbsp;{{this.payment.createTime|format('yyyy-MM-dd hh:mm:ss')}}</p>
            <p>付款时间：&nbsp;&nbsp;&nbsp;{{this.payment.fuTime|format('yyyy-MM-dd hh:mm:ss')}}</p>
            <p>完成时间：&nbsp;&nbsp;&nbsp;{{this.payment.overTime|format('yyyy-MM-dd hh:mm:ss')}}</p>
          </div>

          <!--          充值状态为交易关闭展示-->
          <div v-if="this.status==4" style="float: left">
            <p style="margin-left: 60px">状态：&nbsp;&nbsp;&nbsp;<span style="font-size: 20px; font-weight: bold;">{{this.payment.status==4?'交易关闭':''}}</span><span style="font-size: 14px;color: #545c64">(原因:{{this.payment.failureReason}})</span></p>
            <p>交易号：&nbsp;&nbsp;&nbsp;{{this.payment.transactionNumber}}</p>
            <p>会员类型：&nbsp;&nbsp;&nbsp;{{this.payment.type==1?'快递员':this.payment.type==2?'普通会员':''}}</p>
            <p>手机号码：&nbsp;&nbsp;&nbsp;+86{{this.payment.phone}}</p>
            <p>充值金额：&nbsp;&nbsp;&nbsp;{{this.payment.rechargeAmount}}</p>
            <p>充值后余额：&nbsp;&nbsp;&nbsp;{{this.payment.balanceAfterRecharging}}</p>
            <p>充值币种：&nbsp;&nbsp;&nbsp;{{this.payment.rechargeCurrency==1?'CNY':'PHP'}}</p>
            <p>实际支付CNY：&nbsp;&nbsp;&nbsp;{{this.payment.actualPayment}}</p>
            <p>汇率：&nbsp;&nbsp;&nbsp;{{this.payment.exchangeRate}}</p>
            <p>创建时间：&nbsp;&nbsp;&nbsp;{{this.payment.createTime|format('yyyy-MM-dd hh:mm:ss')}}</p>
            <p>关闭时间：&nbsp;&nbsp;&nbsp;{{this.payment.closingTime|format('yyyy-MM-dd hh:mm:ss')}}</p>
          </div>

          <!--          充值状态为交易关闭展示-->
          <div v-if="this.status==5" style="float: left">
            <p style="margin-left: 60px">状态：&nbsp;&nbsp;&nbsp;<span style="font-size: 20px; font-weight: bold;">{{this.payment.status==5?'充值失败':''}}</span><span v-if="this.payment.failureReason!=null &&this.payment.failureReason!=''" style="font-size: 14px;color: #545c64">(原因:{{this.payment.failureReason}})</span></p>
            <p>交易号：&nbsp;&nbsp;&nbsp;{{this.payment.transactionNumber}}</p>
            <p>会员类型：&nbsp;&nbsp;&nbsp;{{this.payment.type==1?'快递员':this.payment.type==2?'普通会员':''}}</p>
            <p>手机号码：&nbsp;&nbsp;&nbsp;+86{{this.payment.phone}}</p>
            <p>充值金额：&nbsp;&nbsp;&nbsp;{{this.payment.rechargeAmount}}</p>
            <p>充值后余额：&nbsp;&nbsp;&nbsp;{{this.payment.balanceAfterRecharging}}</p>
            <p>充值币种：&nbsp;&nbsp;&nbsp;{{this.payment.rechargeCurrency==1?'CNY':'PHP'}}</p>
            <p>实际支付CNY：&nbsp;&nbsp;&nbsp;{{this.payment.actualPayment}}</p>
            <p>汇率：&nbsp;&nbsp;&nbsp;{{this.payment.exchangeRate}}</p>
            <p>付款方式：&nbsp;&nbsp;&nbsp;{{this.payment.rechargeChannels==1?'微信支付':this.payment.rechargeChannels==2?'支付宝支付':'贝宝支付'}}</p>
            <p>付款账号：&nbsp;&nbsp;&nbsp;{{this.payment.registerIp}}</p>
            <p>创建时间：&nbsp;&nbsp;&nbsp;{{this.payment.createTime|format('yyyy-MM-dd hh:mm:ss')}}</p>
            <p>付款时间：&nbsp;&nbsp;&nbsp;{{this.payment.fuTime|format('yyyy-MM-dd hh:mm:ss')}}</p>
            <p>完成时间：&nbsp;&nbsp;&nbsp;{{this.payment.overTime|format('yyyy-MM-dd hh:mm:ss')}}</p>
          </div>

        </div>


      </el-main>
    </el-container>
  </el-container>
</template>

<script>
// import index from "vue-lazyload";
import axios from "axios";

export default {
  filters:{
    format(value,arg){
      function dateFormat(date, format) {
        if (typeof date === "string") {
          var mts = date.match(/(\/Date\((\d+)\)\/)/);
          if (mts && mts.length >= 3) {
            date = parseInt(mts[2]);
          }
        }
        date = new Date(date);
        if (!date || date.toUTCString() == "Invalid Date") {
          return "";
        }
        var map = {
          "M": date.getMonth() + 1, //月份
          "d": date.getDate(), //日
          "h": date.getHours(), //小时
          "m": date.getMinutes(), //分
          "s": date.getSeconds(), //秒
          "q": Math.floor((date.getMonth() + 3) / 3), //季度
          "S": date.getMilliseconds() //毫秒
        };
        format = format.replace(/([yMdhmsqS])+/g, function (all, t) {
          var v = map[t];
          if (v !== undefined) {
            if (all.length > 1) {
              v = '0' + v;
              v = v.substr(v.length - 2);
            }
            return v;
          } else if (t === 'y') {
            return (date.getFullYear() + '').substr(4 - all.length);
          }
          return all;
        });
        return format;
      }

      return dateFormat(value,arg);

    }
  },
  data() {
    return {
      activeIndex: '5',
      tableData: [{
      }],
      guiList: [{}],
      pageNumber: 1,
      pageSize: 2,
      total: 0,
      multipleSelection: [],
      form:{
        id:'',
      },
      dialogVisible:false,
      dialogVisible2:false,
      idd:'',
      phone:'',
      status:'',
      payment:{},

    };
  },
  methods: {
    baoguo(){
      this.$router.push(
          {path: "/OutPackage"}
      )
    },
    tiaozhuan(){
      this.$router.push({
        path:'/zhanghuPage.vue'
      })
    },
    zhanghu(){
      this.$router.push({
        path:'/zhanghuPage'
      })
    },
    other(){
      this.$router.push(
          {path: "/otherView"}
      )
    },
    huiyuan(){
      this.$router.push(
          {path: "/expressList"}
      )
    },
    yijian(){
      this.$router.push({
        path:'/feebackPage'
      })
    },
    huilv(){
      this.$router.push({
        path:'/huilvPage'
      })
    },
    chongzhiji(){
      this.$router.push({
        path:'/chongZhiPage'
      })
    },

    zhifu(){
      this.$router.push({
        path:'/zhifuPage'
      })
    },

    goToMachine(){
      this.$router.push({
        path:'/machineHome'
      })
    },
    fanhui(){
      this.$router.push({
        path:'/chongZhiPage'
      })
    },


  },
  created() {

    axios.get('http://localhost:8876/recharge/selectFindById?id='+this.$route.query.id).then(response=>{
      this.payment=response.data;
      console.log("777777777cansouyounoaiyijiuxiangdayuluoxiazenmerangren77777777777"+this.payment)
    })
    this.status=this.$route.query.status;
  }
};
</script>

<style lang="less">
#app {
  margin-top: 0;
}

.responsive-width {
  width: 300px;
}
.home-container {
  height: 100%;
}

.el-header {
  background-color: #545c64;
  display: flex; //设置显示为flex布局
  justify-content: space-between; //设置为flex左右布局
  padding-left: 0; //左内边距为0（Logo贴左边）
  align-items: center; //元素上下居中（防止右边按钮贴上下边）
  color: #fff;
  font-size: 18px;

  > div {
    //内嵌的div样式
    display: flex;
    align-items: center; //Logo和文字上下居中
    span {
      width: 200px;
      margin-left: 10px; //文字左侧设置间距，防止与Logo紧贴
    }
  }
}

#indexMenu {
  width: 100%;
}

.el-menu {
  background-color: #545c64;
}

.el-aside {
  background-color: #545c64;
  scrollbar-width: none; /* firefox */
  -ms-overflow-style: none; /* IE 10+ */
  overflow-x: hidden;
  overflow-y: auto;
}

.el-main {
  background-color: #eaedf1;
}
</style>